<template>
  <div>
    <div class="enter-container">
      <div ref="enterDom" style="background-color: white; padding: 50px">
        <div class="title">进修录取通知书</div>
        <div>
          <span class="underline">{{ form.unitHospitalName }}</span>
        </div>
        <div class="indent">
          经审核，同意<span class="underline"> {{ form.userName }} </span
          >，<span class="underline">
            进修工号：{{ form.registerNoticeVo.jobNumber || "（进修工号）" }}
          </span>
          同志来复旦大学附属华山医院进修
          <span class="underline"> {{ form.registerDeptName }} </span> 专业。
        </div>
        <div class="indent">
          进修期限：<span class="underline">
            {{ form.registerNoticeVo.startDate }}
          </span>
          -
          <span class="underline"> {{ form.registerNoticeVo.endDate }} </span
          >。<!--，共 <span class="underline"> {{ form.durationName }} </span>-->
        </div>
        <div class="indent">
          请务必在

          <span class="underline">
            {{ form.registerNoticeVo.registerDate }}
          </span>
          凭本通知来我院报到。
        </div>
        <div class="indent">
          报到地点：<span class="underline">{{
            form.registerNoticeVo.registerAddress
          }}</span>
          华山医院地址: 乌鲁木齐中路12号
        </div>
        <div class="indent">
          报到时间：<span class="underline"
            >{{ form.registerNoticeVo.registerTime }}
          </span>
          邮编：200040
        </div>
        <div class="indent">
          交纳进修费{{ form.registerNoticeVo.engageMoney }}元，实验材料费{{
            form.registerNoticeVo.materialMoney
          }}元。{{
            form.joinMicrosutureTrain == 1 ? "显微血管缝合操作培训费2800元" : ""
          }}
        </div>
        <div class="indent bolder">线上缴费操作流程</div>
        <div class="indent">
          第一步：微信关注公众号“华山医院财务资产管理部”，点击“云缴费”，并注册（微信快捷登录或手机号注册）；
        </div>
        <div class="indent">第二步：选择【进修费】，点击进入；</div>
        <div class="indent">
          第三步：输入身份证号，点击“查询”，出现缴费信息，点击“去支付”即可；
        </div>
        <div class="indent">
          第四步：缴费完成后，可在【凭证】或【我的-“缴费记录”】中查到已缴费的信息和电子发票，自行打印即可用于报销。
        </div>
        <div class="indent">
          关于线上缴费，如有疑问，请联系财务资产管理部：谢老师，联系电话：021-52888079。
        </div>
        <div class="indent">
          如持公务卡学员，报到之日至总院门诊10楼财务资产管理部谢老师处现场缴费、开票。未完成缴费者（公务卡除外）将不予报到。
        </div>
        <div class="indent">进修管理联系人：景老师 联系电话：021-52888960</div>
        <!--        <div class="indent">持公务卡学员，报到时请至财务科现场缴费、开票;</div>
        <div class="indent">其余学员请于报到之日前提前至少一周完成转账缴费，并通过问卷https://www.wjx.cn/vm/mR5S05G.aspx#
          上报缴费信息和开票信息。未完成缴费者(公务卡除外)不予报到。
        </div>
        <div class="indent bolder">转账信息如下:</div>
        <div class="indent bolder">户名: {{ form.registerNoticeVo.financialAccount }}</div>
        <div class="indent bolder">开户行: {{ form.registerNoticeVo.bankName }}</div>
        <div class="indent bolder">账号: {{ form.registerNoticeVo.bankCardNumber }}</div>
        <div class="indent bolder">转账时备注: 姓名+进修工号</div>
        <div class="indent bolder">联系电话: {{ form.registerNoticeVo.contactMan }} 联系人:
          {{ form.registerNoticeVo.contactPhone }}
        </div>-->
        <div class="indent bolder">{{ form.registerNoticeVo.remark }}</div>
        <div class="indent">此致</div>
        <div>敬礼</div>
        <div class="sign">
          <div>复旦大学附属华山医院教育处</div>
          <div>
            {{
              parseTime(
                form.registerNoticeVo.createTime,
                "{yyyy}年{mm}月{dd}日"
              )
            }}
          </div>
          <img
            class="img"
            src="../../../../../assets/images/official-seal.png"
          />
        </div>
        <div style="border-bottom: 1px dashed #898a8c"></div>
        <div v-html="form.registerNoticeVo.noticeContent"></div>
      </div>
      <!--      <div class="tips">-->
      <!--        请在阅读完录取通知书后<span class="underline"-->
      <!--          >确认是否可以按时来我院报到？</span-->
      <!--        >-->
      <!--      </div>-->
    </div>
  </div>
</template>

<script>
import { getRegisterInfo } from "@/api/business/registerInfo";
import { parseTime } from "@/utils/ruoyi";

export default {
  props: {
    registerId: null,
    formObj: null,
  },
  data() {
    return {
      form: {},
      noticeForm: {},
      noticeRules: {
        startDate: [
          { required: true, message: "报到日期不能为空", trigger: "blur" },
        ],
        endDate: [
          { required: true, message: "结业日期不能为空", trigger: "blur" },
        ],
        registerTime: [
          {
            required: true,
            message: "请选择报到开始时间、结束时间",
            trigger: "blur",
          },
        ],
        registerAddress: [
          { required: true, message: "报到地点不能为空", trigger: "blur" },
        ],
        engageMoney: [
          { required: true, message: "进修费(元)不能为空", trigger: "blur" },
        ],
        materialMoney: [
          {
            required: true,
            message: "实验材料费(元)不能为空",
            trigger: "blur",
          },
        ],
        bankName: [
          { required: true, message: "开户行不能为空", trigger: "blur" },
        ],
        bankCardNumber: [
          { required: true, message: "银行卡号不能为空", trigger: "blur" },
        ],
        financialAccount: [
          { required: true, message: "财务账号不能为空", trigger: "blur" },
        ],
        contactMan: [
          { required: true, message: "联系人不能为空", trigger: "blur" },
        ],
        contactPhone: [
          { required: true, message: "联系电话不能为空", trigger: "blur" },
        ],
        fax: [{ required: true, message: "传真不能为空", trigger: "blur" }],
        remark: [{ required: true, message: "备注不能为空", trigger: "blur" }],
      },
      detailShow: false,
    };
  },
  watch: {
    formObj: {
      immediate: true,
      handler() {
        console.log(this.formObj);
        this.form = this.formObj;
      },
    },
    registerId: {
      immediate: true,
      handler() {
        if (this.registerId) {
          this.getInfo();
        }
      },
    },
  },
  methods: {
    parseTime,
    getInfo() {
      getRegisterInfo(this.registerId).then((response) => {
        this.form = response.data;
        this.noticeForm = this.form.registerNoticeVo;
        if (this.noticeForm) {
          let split = this.noticeForm.registerTime.split("至");
          this.$set(this.noticeForm, "registerTimeStart", split[0]);
          this.$set(this.noticeForm, "registerTimeEnd", split[1]);
        }
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.enter-container {
  font-family: "Microsoft YaHei";
  font-size: 18px;
  padding: 0 15px;
  line-height: 30px;

  ::v-deep .ql-align-center {
    text-align: center;
  }

  .btn-box {
    display: flex;
    justify-content: flex-end;
  }

  .title {
    text-align: center;
    font-size: 26px;
    font-weight: bolder;
    letter-spacing: 0.5em;
  }

  .indent {
    text-indent: 2em;
  }

  .bolder {
    font-weight: bolder;
  }

  .underline {
    text-decoration: underline;
  }

  .title2 {
    margin: 15px 0;
    text-align: center;
    font-size: 26px;
    font-weight: bolder;
  }

  .sign {
    margin-top: 40px;
    text-align: right;
    font-weight: bolder;
    position: relative;

    .img {
      position: absolute;
      top: -60px;
      right: 20px;
      width: 130px;
      height: 130px;
    }
  }

  .tips {
    margin-top: 50px;
    text-align: center;
    font-weight: bolder;
    color: #a52529;
  }
}
</style>
